package com.ep.modules.app.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ep.common.utils.PageUtils;
import com.ep.modules.app.dao.AppVesselPlanMapper;
import com.ep.modules.app.entity.AppVesselPlan;
import com.ep.modules.app.entity.AppVesselPlanExample;
import com.ep.modules.app.service.AppVesselPlanService;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AppVesselPlanServiceImpl implements AppVesselPlanService {
    @Autowired
    private AppVesselPlanMapper appVesselPlanMapper;

    public PageUtils queryPage(Map<String, Object> params) {
        String searchKey = (String)params.get("searchKey");
        Long searchUserId = (Long)params.get("searchUserId");
        AppVesselPlanExample example = new AppVesselPlanExample();
        AppVesselPlanExample.Criteria criteria = example.createCriteria();
        List<AppVesselPlan> list = appVesselPlanMapper.selectByExample(example);
        Page<AppVesselPlan> page = new Page<>();
        page.setRecords(list);
        return new PageUtils(page);
    }

    public AppVesselPlan getById(Long id) {
        return appVesselPlanMapper.selectByPrimaryKey(id.intValue());
    }

    public void save(AppVesselPlan entity) {

        //appVesselPlanMapper.insert(entity);
    }

    public void update(AppVesselPlan entity) {

        //appVesselPlanMapper.updateByPrimaryKeySelective(entity);
    }

    public void deleteBatch(Long[] ids) {
        for (Long id : ids) {
                appVesselPlanMapper.deleteByPrimaryKey(id.intValue());
        }
    }
}